var page= 0;
$(function(){   
    setActive2ndMenu(0);
	var Project = Parse.Object.extend(TABLE_PROJECT);
	var query = new Parse.Query(Project);
	var prolist;
    var pagesize = 10;
	prolist='';
    
   query.limit(pagesize);
	query.find({
	  success: function(results) {	  
		  //prolist = prolist + 
          displayProject(results);
          query.count({
          success: function(count) {
            if(count <pagesize){
                 $('#viewmore').hide();
            }
            else{
                $('#viewmore').show();
            }
          },
          error: function(error) {
          }
        });
         
		  
	  },
	  error: function(error) {
		//alert("Error: " + error.code + " " + error.message);
        displayNoData('#project-list','No data found');
	  }
	});
        displayColumnRight();
	
});

function viewmorepro(){
    page++;
    var Project = Parse.Object.extend("Project");
	var query = new Parse.Query(Project);
	var prolist='';
    var pagesize = 10;
    var pagenext = page+1;
    var pagepre = page-1;
    $("#viewmore_"+page).fadeOut();
    query.skip(page*pagesize);
   query.limit(pagesize);
	query.find({
	  success: function(results) {	  
		  //prolist = prolist + 
          displayProject(results);
          query.count({
          success: function(count) {
            if(count >pagesize*page){
                  $('#viewmore').show();         
                 }
            else{
                $('#viewmore').hide();
            }
          },
          error: function(error) {
          }
        });
         
		  
	  },
	  error: function(error) {
		//alert("Error: " + error.code + " " + error.message);
        displayNoData('#project-list','No data found');
	  }
	});
}